package com.portal.framework.common.lang;

import com.portal.framework.util.ObjectUtil;

public class IdValue<V> extends ObjectPair<V, Integer> implements
		Comparable<IdValue> {

	public IdValue() {
		super();
	}

	public IdValue(Integer key, V value) {
		super(value, key);
	}

	public Integer getId() {
		return getAttribute();
	}

	public void setId(Integer id) {
		setAttribute(id);
	}

	public int compareTo(IdValue o) {
		if (ObjectUtil.equals(getId(), o.getId()))
			return 0;
		return getId().compareTo(o.getId());
	}

}
